home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
snpd9707.zip
/
SETLEVEL.C
< prev
next >
Wrap
Text File
|
1997-07-05
|
2KB
|
56 lines
.I 0 1
/* +++Date last modified: 05-Jul-1997 */
.D 1 1
.I 121 1
case '-': /* Answers are flagged by '-' */
.D 122 1
.I 129 13
j++;
if ((wk_ptr = strtok (argv[i]+j, "=")) != NULL)
{
/*
* Allocate space for the new answer entry and
* link in into the list. Answers are linked
* into the list in reverse order from their
* command line specification since the logic
* is considerably simpler and it shouldn't
* matter much anyway.
*/
if (answer_tab == NULL)
.D 130 2
.I 132 10
answer_tab = wk_ans = (VALID_ANS *)
calloc (1, sizeof(VALID_ANS));
}
else
{
wk_ans = (VALID_ANS *)
calloc (1, sizeof(VALID_ANS));
wk_ans->next_ans = answer_tab;
answer_tab = wk_ans;
}
.D 133 21
.I 155 8
* Store the answer string and errorlevel value
* into the answer element.
*/
wk_ans->ans_key = strdup (wk_ptr);
wk_ptr = strtok (NULL, "=");
if (wk_ptr != NULL)
{
.D 156 8
.I 164 6
* Allow only positive returns since -1 is
* and error return from the program.
*/
wk_ans->rtn_err_lev =
abs (atoi (wk_ptr));
.D 165 8
.I 173 2
else wk_ans->rtn_err_lev = 0;
}
.D 186 1